package com.desire.mapper;

import com.desire.entity.Book;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.cache.decorators.FifoCache;

import java.util.List;

/**
 * @author LittleDesire
 * @description
 * @date 2022-04-15 周五 15:12
 * @since 17
 */
@Mapper
@CacheNamespace(eviction = FifoCache.class, flushInterval = 60000,size = 1024,readWrite = true)
public interface BookMapper {
    /**
     * 开启二级缓存，实体类必须实现序列化
     */
    @Select("select id,name,author,price from oadb.book")
    List<Book> queryBook();
}
